<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Room extends CI_Controller 
{
	function _construct()
	{
		parent::_construct();
		$this->load->helper(array('form', 'url'));
		$this->load->library('session');
	}
	
	function sv()//sinh vien
	{
		$this->load->helper(array('form', 'url'));
		$malop = $_POST['malop'];
		$phong = $_POST['phong'];
		$this->load->library('session');
		$MSSV = $this->session->userdata('name');
		$khoa = $this->session->userdata('khoa');
		$this->load->model('index/mlogin');
		switch($khoa)
		{
			case "mmt":
				$TenSV = $this->mlogin->getNameMMT($MSSV);
				break;
			case "khmt":
				$TenSV = $this->mlogin->getNameKHMT($MSSV);
				break;
			case "ktmt":
				$TenSV = $this->mlogin->getNameKTMT($MSSV);
				break;
			case "httt":
				$TenSV = $this->mlogin->getNameHTTT($MSSV);
				break;
			case "cnpm":
				$TenSV = $this->mlogin->getNameCNPM($MSSV);
				break;
		}
		$data['name']=$TenSV;
		$data['flashvar_str']="room_id=$malop&name=$TenSV";
		$this->load->view('index/vroomsv',$data);
	}//end sv
	
	function gv()
	{
		$this->load->helper(array('form', 'url'));
		$this->load->library('session');
		$malop = $_POST['malop'];
		//$malop = "aa";
		$phong = $_POST['phong'];
		$this->load->library('session');
		$MaGV = $this->session->userdata('name');
		
		$this->load->model('index/mlogin');
		$TenGV = $this->mlogin->getTenGV($MaGV);
		//$TenGV ="aaaaaaaa";
		$data['name']=$TenGV;
		
		$data['flashvar_str']="room_id=$malop&name=$TenGV";
		$this->load->view('index/vroomgv',$data);
	}//end gv
	
	
}